from selenium import webdriver
import tools.readcsv as Csv
import tools.login as Login

# 定义一个空数组
users = []

try:
    # 读取csv文件
    users = Csv.read("./data.csv")
    # print(users)
    # 避免webdriver检测
    options = webdriver.ChromeOptions()
    options.add_argument('--disable-blink-features=AutomationControlled')
    driver = webdriver.Chrome(options=options)
    # 登录模块
    Login.login(driver,users,2)
    # 验证码
    Login.verificationCode(driver)

    # 登出
    Login.logout(driver)
except Exception as e:
    print(e)
    # 退出浏览器
    driver.quit()
    pass
else:
    pass
finally:
    pass